#!/bin/bash
DATE=${Yesterday}
echo "Executing script for date: ${DATE}"

echo "KEYWORD FILE: Updating Areas File. The file that will be updated is styareas.txt"
/sv/customer/apnnz/conf/styareas.php

echo "KEYWORD FILE: executing /sv/customer/apnnz/conf/parse_keywords.php $DATE"
/sv/customer/apnnz/conf/parse_keywords.php $DATE

if [ -f "/sv/customer/apnnz/keyword_data/${DATE}_keywords.txt.gz" ]; then
    echo KEYWORD FILE: SUCCESS!!! /sv/customer/apnnz/keyword_data/${DATE}_keywords.txt.gz - File is present
	exit 0
else
    echo KEYWORD FILE: ERROR!!! /sv/customer/apnnz/keyword_data/${DATE}_keywords.txt.gz - File is not present
	exit 1
fi
